﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
namespace WPFExcelReport
{
    public partial class UIWTS : ViewBase
    {    
        public VWTSCHUSS TMV
        {
            get
            {
                return (VWTSCHUSS)MV;
            }
        }
        public UIWTS()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e);
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if (dwMaster == null)
            {
                KEY = "";
            }
            else
            {
                KEY = TMV.WTSSFLGNR;
            }
        }
        public override void LOADBYAUF()
        {
            TBMain.Clear();
            if (ORDERNUM.Length < 15)
                return;
            PM["SRFNR"] = ORDERNUM.Substring(0, 15); 
            SResult = TMV.LOADBYBS(PM);
            MergeData(SResult, true);
            base.LOADBYAUF();
        }
    }
}
